cmake_minimum_required(VERSION 3.8)
project(path_planner)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(control_msgs REQUIRED)
find_package(trajectory_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(moveit_ros_planning REQUIRED)
find_package(moveit_ros_planning_interface REQUIRED)
find_package(moveit_core REQUIRED)
find_package(robot_state_publisher REQUIRED)
find_package(controller_manager_msgs REQUIRED)

add_executable(path2_es src/path2_es.cpp)
ament_target_dependencies(path2_es
  rclcpp rclcpp_action control_msgs trajectory_msgs geometry_msgs
  moveit_ros_planning moveit_ros_planning_interface moveit_core controller_manager_msgs
)

add_executable(path2_csv src/path2_csv.cpp)
ament_target_dependencies(path2_csv
  rclcpp rclcpp_action control_msgs trajectory_msgs geometry_msgs
  moveit_ros_planning moveit_ros_planning_interface moveit_core
)

add_executable(fk_solver src/fk_solver.cpp)
ament_target_dependencies(fk_solver
  rclcpp rclcpp_action control_msgs trajectory_msgs geometry_msgs
  moveit_ros_planning moveit_ros_planning_interface moveit_core
)

install(TARGETS path2_es path2_csv fk_solver
  DESTINATION lib/${PROJECT_NAME})

ament_package()
